<?php
/**
 * 活动表
 */
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateActivityExtendTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('activity_extend', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('activity_id')->comment('活动ID');
            $table->integer('total')->default(0)->comment('总共抽奖次数');
            $table->timestamps();
            $table->softDeletes();
        });
        //添加表注释
        \Illuminate\Support\Facades\DB::statement("ALTER TABLE `".config('database.connections.mysql.prefix')."activity_extend` comment'活动表'");
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('activity_extend');
    }
}
